package com.kkb.dao;

import com.kkb.pojo.Customer;
import com.kkb.util.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

public class CustomerDao {
    private  QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());
    public void addCustomer(Customer customer) throws SQLException {
        String sql = "insert into tb_customer values(?,?,?,?,?,?,?)";
        Object[] params = {
            customer.getCust_id(),customer.getCust_name(),customer.getCust_source(),customer.getCust_industry(),
            customer.getCust_level(),customer.getCust_phone(),customer.getCust_mobile()
        };
        this.queryRunner.update(sql, params);
    }
}
